<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> 
    <title>运维监控系统之Open-Falcon - 天地维杰网</title>
    <meta name="keywords" content="系统架构,shutdown,不与天斗,Domino,博客,程序员,架构师,笔记,技术,分享,java,Redis">
    
    <meta property="og:title" content="运维监控系统之Open-Falcon">
    <meta property="og:site_name" content="天地维杰网">
    <meta property="og:image" content="/img/author.jpg"> 
    <meta name="title" content="运维监控系统之Open-Falcon - 天地维杰网" />
    <meta name="description" content="1、监控系统，可以从运营级别（基本配置即可），以及应用级别（二次开发，通过端口进行日志上报），对服务器、操作系统、中间件、应用进行全面的监控，及报警，对我们的系统正常运行的作用非常重要。
2、基础监控
CPU、Load、内存、磁盘、IO、网络相关、内核参数、ss 统计输出、端口采集、核心服务的进程存活信息采集、关键业务进程资源消耗、NTP offset采集、DNS解析采集，这些指标，都是open-falcon的agent组件直接支持的。" />
     
    <link rel="shortcut icon" href="http://www.shutdown.cn/img/favicon.ico" />
    <link rel="apple-touch-icon" href="http://www.shutdown.cn/img/apple-touch-icon.png" />
    <link rel="apple-touch-icon-precomposed" href="http://www.shutdown.cn/img/apple-touch-icon.png" />
    <link href="http://www.shutdown.cn/js/vendor/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />
    <link href="http://www.shutdown.cn/js/vendor/fancybox/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />
    <link href="http://www.shutdown.cn/css/main.css" rel="stylesheet" type="text/css" />
    <link href="http://www.shutdown.cn/css/syntax.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Pisces',
    sidebar: {"position":"left","display":"post"},
     fancybox: true, 
    motion: true
  };
</script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-7826003325059020" crossorigin="anonymous"></script>
</head>
<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">
<div class="container one-collumn sidebar-position-left page-home  ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"> <div class="site-meta  custom-logo ">

  <div class="custom-logo-site-title">
    <a href="http://www.shutdown.cn"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">天地维杰网</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">人如秋鸿来有信，事若春梦了无痕</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
    <ul id="menu" class="menu">
      
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />首页
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/redis/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-battery-full"></i> <br />Redis
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/java/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-coffee"></i> <br />java
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/linux/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-linux"></i> <br />linux
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/daily/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-bug"></i> <br />日常问题
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/spring/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-child"></i> <br />Spring和Springboot
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/mac/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-fire"></i> <br />Mac相关
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/middleware/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-gavel"></i> <br />中间件
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/jiagou/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-rocket"></i> <br />架构
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/python/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-ship"></i> <br />python
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/front/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-bolt"></i> <br />前端
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/jvm/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-balance-scale"></i> <br />jvm
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/c/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-battery-empty"></i> <br />c语言
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/web3/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-web3"></i> <br />web3
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/post/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />归档
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/about/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />关于
          </a>
        </li>
      
      <li class="menu-item menu-item-search">
        <a href="javascript:;" class="popup-trigger"> <i class="menu-item-icon fa fa-search fa-fw"></i> <br /> 搜索</a>
      </li>
    </ul>
    <div class="site-search">
      <div class="popup">
 <span class="search-icon fa fa-search"></span>
 <input type="text" id="local-search-input">
 <div id="local-search-result"></div>
 <span class="popup-btn-close">close</span>
</div>

    </div>
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            
<section id="posts" class="posts-expand">
  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <header class="post-header">
      <h1 class="post-title" itemprop="name headline">
        <a class="post-title-link" href="http://www.shutdown.cn/post/something-about-open-falcon/" itemprop="url">
        运维监控系统之Open-Falcon
        </a>
      </h1>
      <div class="post-meta">
      <span class="post-time">
<span class="post-meta-item-icon">
    <i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">时间：</span>
<time itemprop="dateCreated" datetime="2016-03-22T13:04:35+08:00" content="2022-08-04">
    2022-08-04
</time>
</span> 
      

  <span class="post-category" >
  &nbsp; | &nbsp;
  <span class="post-meta-item-icon">
    <i class="fa fa-folder-o"></i>
  </span>
  <span class="post-meta-item-text">分类：</span>
  
    <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
      <a href="http://www.shutdown.cn/categories/middleware" itemprop="url" rel="index">
        <span itemprop="name">middleware</span>
      </a>
      &nbsp; 
    </span>
  
</span>


      
 <span>
&nbsp; | &nbsp;
<span class="post-meta-item-icon">
    <i class="fa fa-eye"></i>
</span>
<span class="post-meta-item-text">转载</span>
</span>

       <span>
&nbsp; | &nbsp;
<span class="post-meta-item-icon">
    <i class="fa fa-eye"></i>
</span>
<span class="post-meta-item-text">阅读：</span>
<span class="leancloud-visitors-count">5393 字 ~11分钟</span>
</span>
      </div>
    </header>
    <div class="post-body" itemprop="articleBody">
    
    <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-fallback" data-lang="fallback"> 文章系转载，便于整理和分类，原文地址：https://www.cnblogs.com/nulige/p/7741580.html</code></pre></div>
    

    

<h3 id="一-open-falcon介绍">一、Open-Falcon介绍</h3>

<p>1、监控系统，可以从运营级别（基本配置即可），以及应用级别（二次开发，通过端口进行日志上报），对服务器、操作系统、中间件、应用进行全面的监控，及报警，对我们的系统正常运行的作用非常重要。</p>

<p>2、基础监控</p>

<p>CPU、Load、内存、磁盘、IO、网络相关、内核参数、ss 统计输出、端口采集、核心服务的进程存活信息采集、关键业务进程资源消耗、NTP offset采集、DNS解析采集，这些指标，都是open-falcon的agent组件直接支持的。</p>

<p>Linux运维基础采集项：<a href="http://book.open-falcon.org/zh/faq/linux-metrics.html">http://book.open-falcon.org/zh/faq/linux-metrics.html</a></p>

<p>对于这些基础监控选项全部理解透彻的时刻，也就是对Linux运行原理及命令进阶的时刻。</p>

<p>3、第三方监控</p>

<p>术业有专攻，运行在OS上的应用甚多，Open-Falcon的开发团队不可能把所有的第三方应用的监控全部做完，这个就需要开源社区提供更多的插件，当前对于很多常用的第三方应用都有相关插件了。</p>

<p>4、JVM监控</p>

<p>对于Java作为主要开发语言的大多数公司，对于JVM的监控不可或缺。</p>

<p>每个JVM应用的参数，比如GC、类加载、JVM内存、进程、线程，都可以上报给Falcon，而这些参数的获得，都可以通过MxBeans实现。</p>

<p>使用 Java 平台管理 bean：<a href="http://www.ibm.com/developerworks/cn/java/j-mxbeans/">http://www.ibm.com/developerworks/cn/java/j-mxbeans/</a></p>

<p>5、业务应用监控</p>

<p>对于业务需要监控的接口，比如响应时间等。可以根据业务的需要，上报相关数据到Falcon，并通过Falcon查看结果。</p>

<h3 id="二-zabbix-nagios-open-falcon这3大开源运维监控工具的比较">二、Zabbix、Nagios、Open-Falcon这3大开源运维监控工具的比较</h3>

<div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220804155429.png" width = 700 /> </div>

<h3 id="三-open-falcon编写的整个脑洞历程">三、Open-Falcon编写的整个脑洞历程</h3>

<p>参考：</p>

<p><a href="http://mp.weixin.qq.com/s?__biz=MjM5OTcxMzE0MQ==&amp;mid=400225178&amp;idx=1&amp;sn=c98609a9b66f84549e41cd421b4df74d">http://mp.weixin.qq.com/s?__biz=MjM5OTcxMzE0MQ==&amp;mid=400225178&amp;idx=1&amp;sn=c98609a9b66f84549e41cd421b4df74d</a></p>

<p>小米开源监控系统OpenFalcon应对高并发7种手段：</p>

<p><a href="http://h2ex.com/894">http://h2ex.com/894</a></p>

<p>官网：</p>

<p><a href="http://open-falcon.org/">http://open-falcon.org/</a></p>

<p><a href="https://book.open-falcon.org/">https://book.open-falcon.org</a></p>

<p><a href="https://github.com/open-falcon/falcon-plus/releases">https://github.com/open-falcon/falcon-plus/releases</a></p>

<p><strong>说明：Open-Falcon部署分为前端（客户端）和后端（服务端）</strong></p>

<h3 id="四-后端部署-服务端">四、后端部署（服务端）</h3>

<p>参考官方文档：<a href="https://book.open-falcon.org/zh_0_2/quick_install/prepare.html">https://book.open-falcon.org/zh_0_2/quick_install/prepare.html</a></p>

<p>1、系统环境</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># cat /etc/redhat-release</span>
CentOS Linux release 7.2.1511 <span style="color:#ce5c00;font-weight:bold">(</span>Core<span style="color:#ce5c00;font-weight:bold">)</span></code></pre></div>
<p>2、系统优化</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-fallback" data-lang="fallback">#安装下载软件
yum install wget -y
 
#更换aliyun源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
 
#下载epel源
yum install epel-release.noarch -y
rpm -Uvh http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm
yum clean all
yum makecache
 
#下载常用软件
yum install git telnet net-tools tree nmap sysstat lrzsz dos2unix tcpdump ntpdate -y
 
#配置时间同步
ntpdate cn.pool.ntp.org
 
#更改主机名
hostnamectl set-hostname open-falcon-server
hostname open-falcon-server
 
#开启缓存
sed -i &#39;s#keepcache=0#keepcache=1#g&#39; /etc/yum.conf 
grep keepcache /etc/yum.conf
 
#关闭selinux
sed -i &#39;s/SELINUX=enforcing/SELINUX=disabled/g&#39; /etc/selinux/config
setenforce 0
 
#关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service</code></pre></div>
<p>3、软件环境准备</p>

<p>安装 redis</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-fallback" data-lang="fallback">yum install redis -y</code></pre></div>
<p>redis常用命令</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-text" data-lang="text">redis-server     redis 服务端
redis-cli　　　　redis 命令行客户端
redis-benchmark  redis 性能测试工具
redis-check-aof 　　	AOF文件修复工具
redis-check-dump  	RDB文件修复工具
redis-sentinel 　　  Sentinel 服务端</code></pre></div>
<p>#启动redis</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#8f5902;font-style:italic">#启动redis</span>
<span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># redis-server &amp;</span>
<span style="color:#ce5c00;font-weight:bold">[</span>1<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#0000cf;font-weight:bold">3308</span>
<span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># 3308:C 27 Oct 08:37:26.435 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf</span>
3308:M <span style="color:#0000cf;font-weight:bold">27</span> Oct 08:37:26.436 * Increased maximum number of open files to <span style="color:#0000cf;font-weight:bold">10032</span> <span style="color:#ce5c00;font-weight:bold">(</span>it was originally <span style="color:#204a87">set</span> to 1024<span style="color:#ce5c00;font-weight:bold">)</span>.
                _._                                                  
           _.-<span style="color:#4e9a06">`</span><span style="color:#4e9a06">`</span>__ <span style="color:#4e9a06">&#39;&#39;</span>-._                                             
      _.-<span style="color:#4e9a06">`</span><span style="color:#4e9a06">`</span>    <span style="color:#4e9a06">`</span>.  <span style="color:#4e9a06">`</span>_.  <span style="color:#4e9a06">&#39;&#39;</span>-._           Redis 3.2.10 <span style="color:#ce5c00;font-weight:bold">(</span>00000000/0<span style="color:#ce5c00;font-weight:bold">)</span> <span style="color:#0000cf;font-weight:bold">64</span> bit
  .-<span style="color:#4e9a06">`</span><span style="color:#4e9a06">`</span> .-<span style="color:#4e9a06">`</span><span style="color:#4e9a06">`</span><span style="color:#4e9a06">`</span>.  <span style="color:#4e9a06">`</span><span style="color:#4e9a06">`</span><span style="color:#4e9a06">`</span><span style="color:#4e9a06">\/</span>    _.,_ <span style="color:#4e9a06">&#39;&#39;</span>-._                                   
 <span style="color:#ce5c00;font-weight:bold">(</span>    <span style="color:#4e9a06">&#39;      ,       .-`  | `,    )     Running in standalone mode
</span><span style="color:#4e9a06"> |`-._`-...-` __...-.``-._|&#39;</span><span style="color:#4e9a06">`</span> _.-<span style="color:#4e9a06">&#39;|     Port: 6379
</span><span style="color:#4e9a06"> |    `-._   `._    /     _.-&#39;</span>    <span style="color:#000;font-weight:bold">|</span>     PID: <span style="color:#0000cf;font-weight:bold">3308</span>
  <span style="color:#4e9a06">`</span>-._    <span style="color:#4e9a06">`</span>-._  <span style="color:#4e9a06">`</span>-./  _.-<span style="color:#4e9a06">&#39;    _.-&#39;</span>                                  
 <span style="color:#000;font-weight:bold">|</span><span style="color:#4e9a06">`</span>-._<span style="color:#4e9a06">`</span>-._    <span style="color:#4e9a06">`</span>-.__.-<span style="color:#4e9a06">&#39;    _.-&#39;</span>_.-<span style="color:#4e9a06">&#39;|                                  
</span><span style="color:#4e9a06"> |    `-._`-._        _.-&#39;</span>_.-<span style="color:#4e9a06">&#39;    |           http://redis.io        
</span><span style="color:#4e9a06">  `-._    `-._`-.__.-&#39;</span>_.-<span style="color:#4e9a06">&#39;    _.-&#39;</span>                                   
 <span style="color:#000;font-weight:bold">|</span><span style="color:#4e9a06">`</span>-._<span style="color:#4e9a06">`</span>-._    <span style="color:#4e9a06">`</span>-.__.-<span style="color:#4e9a06">&#39;    _.-&#39;</span>_.-<span style="color:#4e9a06">&#39;|                                  
</span><span style="color:#4e9a06"> |    `-._`-._        _.-&#39;</span>_.-<span style="color:#4e9a06">&#39;    |                                  
</span><span style="color:#4e9a06">  `-._    `-._`-.__.-&#39;</span>_.-<span style="color:#4e9a06">&#39;    _.-&#39;</span>                                   
      <span style="color:#4e9a06">`</span>-._    <span style="color:#4e9a06">`</span>-.__.-<span style="color:#4e9a06">&#39;    _.-&#39;</span>                                      
          <span style="color:#4e9a06">`</span>-._        _.-<span style="color:#4e9a06">&#39;                                           
</span><span style="color:#4e9a06">              `-.__.-&#39;</span>                                               
 
3308:M <span style="color:#0000cf;font-weight:bold">27</span> Oct 08:37:26.437 <span style="color:#8f5902;font-style:italic"># WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.</span>
3308:M <span style="color:#0000cf;font-weight:bold">27</span> Oct 08:37:26.437 <span style="color:#8f5902;font-style:italic"># Server started, Redis version 3.2.10</span>
3308:M <span style="color:#0000cf;font-weight:bold">27</span> Oct 08:37:26.437 <span style="color:#8f5902;font-style:italic"># WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add &#39;vm.overcommit_memory = 1&#39; to /etc/sysctl.conf and then reboot or run the command &#39;sysctl vm.overcommit_memory=1&#39; for this to take effect.</span>
3308:M <span style="color:#0000cf;font-weight:bold">27</span> Oct 08:37:26.438 <span style="color:#8f5902;font-style:italic"># WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command &#39;echo never &gt; /sys/kernel/mm/transparent_hugepage/enabled&#39; as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.</span>
3308:M <span style="color:#0000cf;font-weight:bold">27</span> Oct 08:37:26.438 * The server is now ready to accept connections on port <span style="color:#0000cf;font-weight:bold">6379</span></code></pre></div>
<p>#安装mysql</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic">#wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm</span>  
 
<span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># ll</span>
total <span style="color:#0000cf;font-weight:bold">12</span>
-rw-------. <span style="color:#0000cf;font-weight:bold">1</span> root root <span style="color:#0000cf;font-weight:bold">1262</span> Oct <span style="color:#0000cf;font-weight:bold">27</span>  <span style="color:#0000cf;font-weight:bold">2017</span> anaconda-ks.cfg
-rw-r--r--. <span style="color:#0000cf;font-weight:bold">1</span> root root <span style="color:#0000cf;font-weight:bold">6140</span> Nov <span style="color:#0000cf;font-weight:bold">12</span>  <span style="color:#0000cf;font-weight:bold">2015</span> mysql-community-release-el7-5.noarch.rpm
 
<span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># rpm -ivh mysql-community-release-el7-5.noarch.rpm</span> 
Preparing...                          <span style="color:#8f5902;font-style:italic">################################# [100%]</span>
Updating / installing...
   1:mysql-community-release-el7-5    <span style="color:#8f5902;font-style:italic">################################# [100%]</span>
<span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># ll /etc/yum.repos.d/</span>
total <span style="color:#0000cf;font-weight:bold">48</span>
-rw-r--r--. <span style="color:#0000cf;font-weight:bold">1</span> root root <span style="color:#0000cf;font-weight:bold">2573</span> Nov <span style="color:#0000cf;font-weight:bold">21</span>  <span style="color:#0000cf;font-weight:bold">2014</span> CentOS-Base.repo
-rw-r--r--. <span style="color:#0000cf;font-weight:bold">1</span> root root <span style="color:#0000cf;font-weight:bold">1664</span> Dec  <span style="color:#0000cf;font-weight:bold">9</span>  <span style="color:#0000cf;font-weight:bold">2015</span> CentOS-Base.repo.backup
-rw-r--r--. <span style="color:#0000cf;font-weight:bold">1</span> root root <span style="color:#0000cf;font-weight:bold">1309</span> Dec  <span style="color:#0000cf;font-weight:bold">9</span>  <span style="color:#0000cf;font-weight:bold">2015</span> CentOS-CR.repo
-rw-r--r--. <span style="color:#0000cf;font-weight:bold">1</span> root root  <span style="color:#0000cf;font-weight:bold">649</span> Dec  <span style="color:#0000cf;font-weight:bold">9</span>  <span style="color:#0000cf;font-weight:bold">2015</span> CentOS-Debuginfo.repo
-rw-r--r--. <span style="color:#0000cf;font-weight:bold">1</span> root root  <span style="color:#0000cf;font-weight:bold">290</span> Dec  <span style="color:#0000cf;font-weight:bold">9</span>  <span style="color:#0000cf;font-weight:bold">2015</span> CentOS-fasttrack.repo
-rw-r--r--. <span style="color:#0000cf;font-weight:bold">1</span> root root  <span style="color:#0000cf;font-weight:bold">630</span> Dec  <span style="color:#0000cf;font-weight:bold">9</span>  <span style="color:#0000cf;font-weight:bold">2015</span> CentOS-Media.repo
-rw-r--r--. <span style="color:#0000cf;font-weight:bold">1</span> root root <span style="color:#0000cf;font-weight:bold">1331</span> Dec  <span style="color:#0000cf;font-weight:bold">9</span>  <span style="color:#0000cf;font-weight:bold">2015</span> CentOS-Sources.repo
-rw-r--r--. <span style="color:#0000cf;font-weight:bold">1</span> root root <span style="color:#0000cf;font-weight:bold">1952</span> Dec  <span style="color:#0000cf;font-weight:bold">9</span>  <span style="color:#0000cf;font-weight:bold">2015</span> CentOS-Vault.repo
-rw-r--r--. <span style="color:#0000cf;font-weight:bold">1</span> root root  <span style="color:#0000cf;font-weight:bold">951</span> Jun <span style="color:#0000cf;font-weight:bold">24</span> 23:04 epel.repo
-rw-r--r--. <span style="color:#0000cf;font-weight:bold">1</span> root root <span style="color:#0000cf;font-weight:bold">1050</span> Jun <span style="color:#0000cf;font-weight:bold">24</span> 23:04 epel-testing.repo
-rw-r--r--. <span style="color:#0000cf;font-weight:bold">1</span> root root <span style="color:#0000cf;font-weight:bold">1209</span> Jan <span style="color:#0000cf;font-weight:bold">29</span>  <span style="color:#0000cf;font-weight:bold">2014</span> mysql-community.repo
-rw-r--r--. <span style="color:#0000cf;font-weight:bold">1</span> root root <span style="color:#0000cf;font-weight:bold">1060</span> Jan <span style="color:#0000cf;font-weight:bold">29</span>  <span style="color:#0000cf;font-weight:bold">2014</span> mysql-community-source.repo
 
<span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic">#yum install -y mysql-server&lt;br&gt;</span>
<span style="color:#8f5902;font-style:italic">#启动mysql并设置开机自启动</span>
<span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># systemctl start mysqld.service</span>
<span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># systemctl enable mysqld.service</span>
 
<span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># mysql -uroot -p</span>
Enter password: 
Welcome to the MySQL monitor. Commands end with <span style="color:#000;font-weight:bold">;</span> or <span style="color:#4e9a06">\g</span>.
Your MySQL connection id is <span style="color:#0000cf;font-weight:bold">2</span>
Server version: 5.6.38 MySQL Community Server <span style="color:#ce5c00;font-weight:bold">(</span>GPL<span style="color:#ce5c00;font-weight:bold">)</span>
 
Copyright <span style="color:#ce5c00;font-weight:bold">(</span>c<span style="color:#ce5c00;font-weight:bold">)</span> 2000, 2017, Oracle and/or its affiliates. All rights reserved.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type <span style="color:#4e9a06">&#39;help;&#39;</span> or <span style="color:#4e9a06">&#39;\h&#39;</span> <span style="color:#204a87;font-weight:bold">for</span> help. Type <span style="color:#4e9a06">&#39;\c&#39;</span> to clear the current input statement.
 
mysql&gt; <span style="color:#204a87">exit</span>
Bye</code></pre></div>
<p>#检查服务</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># netstat -lntup</span>
Active Internet connections <span style="color:#ce5c00;font-weight:bold">(</span>only servers<span style="color:#ce5c00;font-weight:bold">)</span>
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name   
tcp        <span style="color:#0000cf;font-weight:bold">0</span>      <span style="color:#0000cf;font-weight:bold">0</span> 0.0.0.0:6379            0.0.0.0:*               LISTEN      3308/redis-server *
tcp        <span style="color:#0000cf;font-weight:bold">0</span>      <span style="color:#0000cf;font-weight:bold">0</span> 0.0.0.0:22              0.0.0.0:*               LISTEN      1443/sshd          
tcp        <span style="color:#0000cf;font-weight:bold">0</span>      <span style="color:#0000cf;font-weight:bold">0</span> 127.0.0.1:25            0.0.0.0:*               LISTEN      1634/master        
tcp6       <span style="color:#0000cf;font-weight:bold">0</span>      <span style="color:#0000cf;font-weight:bold">0</span> :::3306                 :::*                    LISTEN      3283/mysqld        
tcp6       <span style="color:#0000cf;font-weight:bold">0</span>      <span style="color:#0000cf;font-weight:bold">0</span> :::6379                 :::*                    LISTEN      3308/redis-server *
tcp6       <span style="color:#0000cf;font-weight:bold">0</span>      <span style="color:#0000cf;font-weight:bold">0</span> :::22                   :::*                    LISTEN      1443/sshd          
tcp6       <span style="color:#0000cf;font-weight:bold">0</span>      <span style="color:#0000cf;font-weight:bold">0</span> ::1:25                  :::*                    LISTEN      1634/master        
udp        <span style="color:#0000cf;font-weight:bold">0</span>      <span style="color:#0000cf;font-weight:bold">0</span> 0.0.0.0:68              0.0.0.0:*                           2042/dhclient      
udp        <span style="color:#0000cf;font-weight:bold">0</span>      <span style="color:#0000cf;font-weight:bold">0</span> 0.0.0.0:4817            0.0.0.0:*                           2042/dhclient      
udp6       <span style="color:#0000cf;font-weight:bold">0</span>      <span style="color:#0000cf;font-weight:bold">0</span> :::20380                :::*                                2042/dhclient</code></pre></div>
<p>4、初始化MySQL表结构（备注：导入表结构后，注意检查）</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#204a87">cd</span> /tmp/ <span style="color:#ce5c00;font-weight:bold">&amp;&amp;</span> git clone https://github.com/open-falcon/falcon-plus.git 
<span style="color:#204a87">cd</span> /tmp/falcon-plus/scripts/mysql/db_schema/
mysql -h 127.0.0.1 -u root -p &lt; 1_uic-db-schema.sql
mysql -h 127.0.0.1 -u root -p &lt; 2_portal-db-schema.sql
mysql -h 127.0.0.1 -u root -p &lt; 3_dashboard-db-schema.sql
mysql -h 127.0.0.1 -u root -p &lt; 4_graph-db-schema.sql
mysql -h 127.0.0.1 -u root -p &lt; 5_alarms-db-schema.sql
rm -rf /tmp/falcon-plus/</code></pre></div>
<p>#设置数据库密码 (备注：用户名：root ,密码: password )</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server open-falcon<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># mysqladmin -uroot password &#34;password&#34;</span>
Warning: Using a password on the <span style="color:#204a87">command</span> line interface can be insecure.</code></pre></div>
<p>#检查导入的数据库表</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server open-falcon<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># mysqladmin -uroot password &#34;password&#34;</span>
Warning: Using a password on the <span style="color:#204a87">command</span> line interface can be insecure.
<span style="color:#8f5902;font-style:italic">#检查导入的数据库表</span>

<span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server open-falcon<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># mysql -uroot -p</span>
Enter password: 
Welcome to the MySQL monitor.  Commands end with <span style="color:#000;font-weight:bold">;</span> or <span style="color:#4e9a06">\g</span>.
Your MySQL connection id is <span style="color:#0000cf;font-weight:bold">35</span>
Server version: 5.6.38 MySQL Community Server <span style="color:#ce5c00;font-weight:bold">(</span>GPL<span style="color:#ce5c00;font-weight:bold">)</span>
 
Copyright <span style="color:#ce5c00;font-weight:bold">(</span>c<span style="color:#ce5c00;font-weight:bold">)</span> 2000, 2017, Oracle and/or its affiliates. All rights reserved.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type <span style="color:#4e9a06">&#39;help;&#39;</span> or <span style="color:#4e9a06">&#39;\h&#39;</span> <span style="color:#204a87;font-weight:bold">for</span> help. Type <span style="color:#4e9a06">&#39;\c&#39;</span> to clear the current input statement.
 
mysql&gt; show databases<span style="color:#000;font-weight:bold">;</span>
+--------------------+
<span style="color:#000;font-weight:bold">|</span> Database           <span style="color:#000;font-weight:bold">|</span>
+--------------------+
<span style="color:#000;font-weight:bold">|</span> information_schema <span style="color:#000;font-weight:bold">|</span>
<span style="color:#000;font-weight:bold">|</span> alarms             <span style="color:#000;font-weight:bold">|</span>
<span style="color:#000;font-weight:bold">|</span> dashboard          <span style="color:#000;font-weight:bold">|</span>
<span style="color:#000;font-weight:bold">|</span> falcon_portal      <span style="color:#000;font-weight:bold">|</span>
<span style="color:#000;font-weight:bold">|</span> graph              <span style="color:#000;font-weight:bold">|</span>
<span style="color:#000;font-weight:bold">|</span> mysql              <span style="color:#000;font-weight:bold">|</span>
<span style="color:#000;font-weight:bold">|</span> performance_schema <span style="color:#000;font-weight:bold">|</span>
<span style="color:#000;font-weight:bold">|</span> uic                <span style="color:#000;font-weight:bold">|</span>
+--------------------+
<span style="color:#0000cf;font-weight:bold">8</span> rows in <span style="color:#204a87">set</span> <span style="color:#ce5c00;font-weight:bold">(</span>0.00 sec<span style="color:#ce5c00;font-weight:bold">)</span>
 
mysql&gt; <span style="color:#204a87">exit</span>
Bye</code></pre></div>
<p>5、配置Go语言开发环境</p>

<p>#安装go语言开发包（备注：安装需要epel源）</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">yum install golang -y</code></pre></div>
<p>#检查版本</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># go version</span>
 go version go1.8.3 linux/amd64</code></pre></div>
<p>#查看go的安装路径</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># find / -name go</span>
/etc/alternatives/go
/var/lib/alternatives/go
/usr/bin/go
/usr/lib/golang/src/cmd/go  <span style="color:#8f5902;font-style:italic">#需要的是这个路径</span>
/usr/lib/golang/src/go
/usr/lib/golang/bin/go
/usr/lib/golang/pkg/linux_amd64/go</code></pre></div>
<p>#设置环境变量GOROOT和GOPATH</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#204a87">export</span> <span style="color:#000">GOROOT</span><span style="color:#ce5c00;font-weight:bold">=</span>/usr/lib/golang
<span style="color:#204a87">export</span> <span style="color:#000">GOPATH</span><span style="color:#ce5c00;font-weight:bold">=</span>/home</code></pre></div>
<p>6、下载编译好的二进制版本</p>

<p><a href="https://github.com/open-falcon/falcon-plus/releases">https://github.com/open-falcon/falcon-plus/releases</a></p>

<p>直接下载官方编译好的<a href="https://github.com/open-falcon/falcon-plus/releases">二进制版本(x86 64位平台)</a>。</p>

<p>#开始安装open-falcon</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># export FALCON_HOME=/home/work</span>
<span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># export WORKSPACE=$FALCON_HOME/open-falcon</span>
<span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># mkdir -p $WORKSPACE</span>
 
<span style="color:#8f5902;font-style:italic">#上传软件</span>
<span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># ll</span>
-rw-r--r--. <span style="color:#0000cf;font-weight:bold">1</span> root root <span style="color:#0000cf;font-weight:bold">40031472</span> Oct <span style="color:#0000cf;font-weight:bold">29</span> <span style="color:#0000cf;font-weight:bold">2017</span> open-falcon-v0.2.1.tar.gz
 
<span style="color:#8f5902;font-style:italic">#解压</span>
<span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># tar -xf open-falcon-v0.2.1.tar.gz -C $WORKSPACE</span>
<span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server ~<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># cd $WORKSPACE</span>
&lt;br&gt;#查看解压结果
<span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server open-falcon<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># ll</span>
total <span style="color:#0000cf;font-weight:bold">3896</span>
drwxrwxr-x. <span style="color:#0000cf;font-weight:bold">7</span> <span style="color:#0000cf;font-weight:bold">501</span> <span style="color:#0000cf;font-weight:bold">501</span>      <span style="color:#0000cf;font-weight:bold">67</span> Aug <span style="color:#0000cf;font-weight:bold">15</span> 19:16 agent
drwxrwxr-x. <span style="color:#0000cf;font-weight:bold">5</span> <span style="color:#0000cf;font-weight:bold">501</span> <span style="color:#0000cf;font-weight:bold">501</span>      <span style="color:#0000cf;font-weight:bold">40</span> Aug <span style="color:#0000cf;font-weight:bold">15</span> 19:16 aggregator
drwxrwxr-x. <span style="color:#0000cf;font-weight:bold">5</span> <span style="color:#0000cf;font-weight:bold">501</span> <span style="color:#0000cf;font-weight:bold">501</span>      <span style="color:#0000cf;font-weight:bold">40</span> Aug <span style="color:#0000cf;font-weight:bold">15</span> 19:16 alarm
drwxrwxr-x. <span style="color:#0000cf;font-weight:bold">6</span> <span style="color:#0000cf;font-weight:bold">501</span> <span style="color:#0000cf;font-weight:bold">501</span>      <span style="color:#0000cf;font-weight:bold">51</span> Aug <span style="color:#0000cf;font-weight:bold">15</span> 19:16 api
drwxrwxr-x. <span style="color:#0000cf;font-weight:bold">5</span> <span style="color:#0000cf;font-weight:bold">501</span> <span style="color:#0000cf;font-weight:bold">501</span>      <span style="color:#0000cf;font-weight:bold">40</span> Aug <span style="color:#0000cf;font-weight:bold">15</span> 19:16 gateway
drwxrwxr-x. <span style="color:#0000cf;font-weight:bold">6</span> <span style="color:#0000cf;font-weight:bold">501</span> <span style="color:#0000cf;font-weight:bold">501</span>      <span style="color:#0000cf;font-weight:bold">51</span> Aug <span style="color:#0000cf;font-weight:bold">15</span> 19:16 graph
drwxrwxr-x. <span style="color:#0000cf;font-weight:bold">5</span> <span style="color:#0000cf;font-weight:bold">501</span> <span style="color:#0000cf;font-weight:bold">501</span>      <span style="color:#0000cf;font-weight:bold">40</span> Aug <span style="color:#0000cf;font-weight:bold">15</span> 19:16 hbs
drwxrwxr-x. <span style="color:#0000cf;font-weight:bold">5</span> <span style="color:#0000cf;font-weight:bold">501</span> <span style="color:#0000cf;font-weight:bold">501</span>      <span style="color:#0000cf;font-weight:bold">40</span> Aug <span style="color:#0000cf;font-weight:bold">15</span> 19:16 judge
drwxrwxr-x. <span style="color:#0000cf;font-weight:bold">5</span> <span style="color:#0000cf;font-weight:bold">501</span> <span style="color:#0000cf;font-weight:bold">501</span>      <span style="color:#0000cf;font-weight:bold">40</span> Aug <span style="color:#0000cf;font-weight:bold">15</span> 19:16 nodata
-rwxrwxr-x. <span style="color:#0000cf;font-weight:bold">1</span> <span style="color:#0000cf;font-weight:bold">501</span> <span style="color:#0000cf;font-weight:bold">501</span> <span style="color:#0000cf;font-weight:bold">3987469</span> Aug <span style="color:#0000cf;font-weight:bold">15</span> 19:16 open-falcon
lrwxrwxrwx. <span style="color:#0000cf;font-weight:bold">1</span> <span style="color:#0000cf;font-weight:bold">501</span> <span style="color:#0000cf;font-weight:bold">501</span>      <span style="color:#0000cf;font-weight:bold">16</span> Aug <span style="color:#0000cf;font-weight:bold">15</span> 19:16 plugins -&gt; ./agent/plugins/
lrwxrwxrwx. <span style="color:#0000cf;font-weight:bold">1</span> <span style="color:#0000cf;font-weight:bold">501</span> <span style="color:#0000cf;font-weight:bold">501</span>      <span style="color:#0000cf;font-weight:bold">15</span> Aug <span style="color:#0000cf;font-weight:bold">15</span> 19:16 public -&gt; ./agent/public/
drwxrwxr-x. <span style="color:#0000cf;font-weight:bold">5</span> <span style="color:#0000cf;font-weight:bold">501</span> <span style="color:#0000cf;font-weight:bold">501</span>      <span style="color:#0000cf;font-weight:bold">40</span> Aug <span style="color:#0000cf;font-weight:bold">15</span> 19:16 transfer</code></pre></div>
<p>7、修改配置文件cfg.json</p>

<p><strong>坑：</strong></p>

<p><strong>部分模块依赖连接数据库，因为如果不修改配置文件，aggregator模块会出现无法启动，graph、hbs、nodata、api、alarm模块会出现开启不报错但是状态为开启失败的情况。</strong></p>

<p>如果需要每个模块都能正常启动，需要将上面模块的cfg.json的数据库信息进行修改。根据本教程的配置，需要修改配置文件所在的目录：</p>

<table>
<thead>
<tr>
<th>模块</th>
<th>配置文件所在路径</th>
</tr>
</thead>

<tbody>
<tr>
<td>aggregator</td>
<td>/home/work/aggregator/config/cfg.json</td>
</tr>

<tr>
<td>graph</td>
<td>/home/work/graph/config/cfg.json</td>
</tr>

<tr>
<td>hbs</td>
<td>/home/work/hbs/config/cfg.json</td>
</tr>

<tr>
<td>nodata</td>
<td>/home/work/nodata/config/cfg.json</td>
</tr>

<tr>
<td>api</td>
<td>/home/work/api/config/cfg.json</td>
</tr>

<tr>
<td>alarm</td>
<td>/home/work/alarm/config/cfg.json</td>
</tr>
</tbody>
</table>

<p>1）修改aggregator的配置文件</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">vim /home/work/open-falcon/ggregator/config/cfg.json</code></pre></div>
<div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220804153837.png" width = 700 /> </div>

<p>mysql的root密码为空，则去掉“password”，若不为空，则用root密码替换“password”。</p>

<p>2）修改graph的配置文件</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">vim /home/work/open-falcon/graph/config/cfg.json</code></pre></div>
<div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220804153928.png" width = 700 /> </div>

<p>mysql的root密码为空，则去掉“password”，若不为空，则用root密码替换“password”。</p>

<p>3）修改hbs的配置文件</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">vim /home/work/open-falcon/s/config/cfg.json</code></pre></div>
<p><div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220804154012.png" width = 700 /> </div></p>

<p>mysql的root密码为空，则去掉“password”，若不为空，则用root密码替换“password”。</p>

<p>4）修改nodata的配置文件</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-fallback" data-lang="fallback">vim /home/work/open-falcon/nodata/config/cfg.json</code></pre></div>
<div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220804154030.png" width = 700 /> </div>

<p>mysql的root密码为空，则去掉“password”，若不为空，则用root密码替换“password”。</p>

<p>5）修改api的配置文件</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-fallback" data-lang="fallback">vim /home/work/open-falcon/api/config/cfg.json</code></pre></div>
<div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220804154129.png" width = 700 /> </div>

<p>mysql的root密码为空，则去掉“password”，若不为空，则用root密码替换“password”。</p>

<p>6）修改alarm的配置文件</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-fallback" data-lang="fallback">vim /home/work/open-falcon/alarm/config/cfg.json</code></pre></div>
<div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220804154202.png" width = 700 /> </div>

<p>mysql的root密码为空，则去掉“password”，若不为空，则用root密码替换“password”。</p>

<p>8、启动后端模块</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server open-falcon<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># cd /home/work/open-falcon</span>
 
<span style="color:#8f5902;font-style:italic">#启动服务</span>
<span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server open-falcon<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># ./open-falcon start</span>
<span style="color:#ce5c00;font-weight:bold">[</span>falcon-graph<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#0000cf;font-weight:bold">25682</span>
<span style="color:#ce5c00;font-weight:bold">[</span>falcon-hbs<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#0000cf;font-weight:bold">25691</span>
<span style="color:#ce5c00;font-weight:bold">[</span>falcon-judge<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#0000cf;font-weight:bold">25699</span>
<span style="color:#ce5c00;font-weight:bold">[</span>falcon-transfer<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#0000cf;font-weight:bold">25705</span>
<span style="color:#ce5c00;font-weight:bold">[</span>falcon-nodata<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#0000cf;font-weight:bold">25711</span>
<span style="color:#ce5c00;font-weight:bold">[</span>falcon-aggregator<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#0000cf;font-weight:bold">25718</span>
<span style="color:#ce5c00;font-weight:bold">[</span>falcon-agent<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#0000cf;font-weight:bold">25726</span>
<span style="color:#ce5c00;font-weight:bold">[</span>falcon-gateway<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#0000cf;font-weight:bold">25733</span>
<span style="color:#ce5c00;font-weight:bold">[</span>falcon-api<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#0000cf;font-weight:bold">25739</span>
<span style="color:#ce5c00;font-weight:bold">[</span>falcon-alarm<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#0000cf;font-weight:bold">25751</span>
 
<span style="color:#8f5902;font-style:italic">#检查服务启动状态</span>
<span style="color:#ce5c00;font-weight:bold">[</span>root@open-falcon-server open-falcon<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># ./open-falcon check</span>
        falcon-graph         UP           <span style="color:#0000cf;font-weight:bold">25682</span>
          falcon-hbs         UP           <span style="color:#0000cf;font-weight:bold">25691</span>
        falcon-judge         UP           <span style="color:#0000cf;font-weight:bold">25699</span>
     falcon-transfer         UP           <span style="color:#0000cf;font-weight:bold">25705</span>
       falcon-nodata         UP           <span style="color:#0000cf;font-weight:bold">25711</span>
   falcon-aggregator         UP           <span style="color:#0000cf;font-weight:bold">25718</span>
        falcon-agent         UP           <span style="color:#0000cf;font-weight:bold">25726</span>
      falcon-gateway         UP           <span style="color:#0000cf;font-weight:bold">25733</span>
          falcon-api         UP           <span style="color:#0000cf;font-weight:bold">25739</span>
        falcon-alarm         UP           <span style="color:#0000cf;font-weight:bold">25751</span></code></pre></div>
<p>#更多的命令行工具用法</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#8f5902;font-style:italic"># ./open-falcon [start|stop|restart|check|monitor|reload] module</span>
./open-falcon start agent
 
./open-falcon check
        falcon-graph         UP           <span style="color:#0000cf;font-weight:bold">53007</span>
          falcon-hbs         UP           <span style="color:#0000cf;font-weight:bold">53014</span>
        falcon-judge         UP           <span style="color:#0000cf;font-weight:bold">53020</span>
     falcon-transfer         UP           <span style="color:#0000cf;font-weight:bold">53026</span>
       falcon-nodata         UP           <span style="color:#0000cf;font-weight:bold">53032</span>
   falcon-aggregator         UP           <span style="color:#0000cf;font-weight:bold">53038</span>
        falcon-agent         UP           <span style="color:#0000cf;font-weight:bold">53044</span>
      falcon-gateway         UP           <span style="color:#0000cf;font-weight:bold">53050</span>
          falcon-api         UP           <span style="color:#0000cf;font-weight:bold">53056</span>
        falcon-alarm         UP           <span style="color:#0000cf;font-weight:bold">53063</span>
 
<span style="color:#8f5902;font-style:italic">#For debugging , You can check $WorkDir/$moduleName/log/logs/xxx.log</span></code></pre></div>
<p>至此后端部署完成。</p>

<p>8、其它用法</p>

<p>#重载配置（备注：修改vi cfg.json配置文件后，可以用下面命令重载配置）</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">curl 127.0.0.1:1988/config/reload</code></pre></div>
<h3 id="五-前端部署-备注-在另外一台服务器上面操作">五、前端部署 （备注：在另外一台服务器上面操作）</h3>

<p>1、创建工作目录</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#204a87">export</span> <span style="color:#000">HOME</span><span style="color:#ce5c00;font-weight:bold">=</span>/home/work
<span style="color:#204a87">export</span> <span style="color:#000">WORKSPACE</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$HOME</span>/open-falcon
mkdir -p <span style="color:#000">$WORKSPACE</span>
<span style="color:#204a87">cd</span> <span style="color:#000">$WORKSPACE</span></code></pre></div>
<p>2、克隆前端组件代码</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">git clone https://github.com/open-falcon/dashboard.git</code></pre></div>
<p>3、安装依赖包</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">yum install -y python-virtualenv
yum install -y python-devel
yum install -y openldap-devel
yum install -y mysql-devel
yum groupinstall <span style="color:#4e9a06">&#34;Development tools&#34;</span> -y</code></pre></div>
<p><font color=red><strong>坑：</strong></font></p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#8f5902;font-style:italic">#省略下面这三步不操作（备注：因执行virtualenv ./env；安装的pip版本为1.4.1，再用pip安装pip_requirements.txt文件中的软件。都会出现报错的情况，导致无法安装成功。主要原因就是pip版本的问题。）解决这个问题，请参考第4步</span>
<span style="color:#8f5902;font-style:italic">#进入目录</span>
<span style="color:#204a87">cd</span> <span style="color:#000">$WORKSPACE</span>/dashboard/
virtualenv ./env
<span style="color:#204a87">source</span> env/bin/activate
<span style="color:#8f5902;font-style:italic">#如果安装了高版本pip，请先卸载pip uninstall pip   再按两次y</span>
<span style="color:#8f5902;font-style:italic">#指定源安装包（备注：这步如果安装不成功，请检查pip版本是否为pip-9.0.1）</span> 
pip install -r pip_requirements.txt -i</code></pre></div>
<p>4、先安装ez_setup.py,再安装pip</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#8f5902;font-style:italic">#下载ez_setup.py</span>
wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py
python ez_setup.py --insecure
 
<span style="color:#8f5902;font-style:italic">#下载pip</span>
wget https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5<span style="color:#ce5c00;font-weight:bold">=</span>35f01da33009719497f01a4ba69d63c9
 
<span style="color:#8f5902;font-style:italic">#解压并安装</span>
tar xf pip-9.0.1.tar.gz 
<span style="color:#204a87">cd</span> pip-9.0.1
python setup.py install
<span style="color:#204a87">cd</span> ..</code></pre></div>
<p>#配置环境变量  (备注：这步不需要操作了)</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#8f5902;font-style:italic">#查看pip路径</span>
<span style="color:#ce5c00;font-weight:bold">[</span>root@prometheus dashboard<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># which pip</span>
/usr/bin/pip
 
<span style="color:#8f5902;font-style:italic">#配置pip环境变量</span>
<span style="color:#ce5c00;font-weight:bold">[</span>root@prometheus dashboard<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># vi /etc/profile</span>
<span style="color:#8f5902;font-style:italic">#pip path</span> 
<span style="color:#204a87">export</span> <span style="color:#000">PATH</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">&#34;</span><span style="color:#4e9a06">/usr/bin/pip/bin:</span><span style="color:#000">$PATH</span><span style="color:#4e9a06">&#34;</span>
<span style="color:#8f5902;font-style:italic">#使环境变量生效source /etc/profile</span>
<span style="color:#8f5902;font-style:italic">#测试是否可用</span>
<span style="color:#ce5c00;font-weight:bold">[</span>root@prometheus dashboard<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># pip</span>
Usage: 
pip &lt;command&gt; <span style="color:#ce5c00;font-weight:bold">[</span>options<span style="color:#ce5c00;font-weight:bold">]</span>
Commands:
install Install packages.
download Download packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
check Verify installed packages have compatible dependencies.
search Search PyPI <span style="color:#204a87;font-weight:bold">for</span> packages.
wheel Build wheels from your requirements.
<span style="color:#204a87">hash</span> Compute hashes of package archives.
completion A helper <span style="color:#204a87">command</span> used <span style="color:#204a87;font-weight:bold">for</span> <span style="color:#204a87">command</span> completion.
<span style="color:#204a87">help</span> Show <span style="color:#204a87">help</span> <span style="color:#204a87;font-weight:bold">for</span> commands.</code></pre></div>
<p>#查看需要安装的软件</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#ce5c00;font-weight:bold">[</span>root@prometheus dashboard<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># cat pip_requirements.txt</span> 
<span style="color:#000">Flask</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>0.10.1
Flask-Babel<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>0.9
<span style="color:#000">Jinja2</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>2.7.2
<span style="color:#000">Werkzeug</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>0.9.4
<span style="color:#000">gunicorn</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>19.1.1
python-dateutil<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>2.2
<span style="color:#000">requests</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>2.3.0
mysql-python
python-ldap</code></pre></div>
<p>#利用pip安装上面这些软件</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#ce5c00;font-weight:bold">[</span>root@prometheus<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># cd /home/work/open-falcon/dashboard&lt;br&gt;&lt;br&gt;#安装软件</span>
<span style="color:#ce5c00;font-weight:bold">[</span>root@prometheus dashboard<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># pip install -r pip_requirements.txt</span>
Collecting <span style="color:#000">Flask</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>0.10.1 <span style="color:#ce5c00;font-weight:bold">(</span>from -r pip_requirements.txt <span style="color:#ce5c00;font-weight:bold">(</span>line 1<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">)</span>
Downloading Flask-0.10.1.tar.gz <span style="color:#ce5c00;font-weight:bold">(</span>544kB<span style="color:#ce5c00;font-weight:bold">)</span>
100% <span style="color:#000;font-weight:bold">|</span>████████████████████████████████<span style="color:#000;font-weight:bold">|</span> 552kB 955kB/s
Collecting Flask-Babel<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>0.9 <span style="color:#ce5c00;font-weight:bold">(</span>from -r pip_requirements.txt <span style="color:#ce5c00;font-weight:bold">(</span>line 2<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">)</span>
Downloading Flask-Babel-0.9.tar.gz
Collecting <span style="color:#000">Jinja2</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>2.7.2 <span style="color:#ce5c00;font-weight:bold">(</span>from -r pip_requirements.txt <span style="color:#ce5c00;font-weight:bold">(</span>line 3<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">)</span>
Downloading Jinja2-2.7.2.tar.gz <span style="color:#ce5c00;font-weight:bold">(</span>378kB<span style="color:#ce5c00;font-weight:bold">)</span>
100% <span style="color:#000;font-weight:bold">|</span>████████████████████████████████<span style="color:#000;font-weight:bold">|</span> 378kB 2.0MB/s
Collecting <span style="color:#000">Werkzeug</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>0.9.4 <span style="color:#ce5c00;font-weight:bold">(</span>from -r pip_requirements.txt <span style="color:#ce5c00;font-weight:bold">(</span>line 4<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">)</span>
Downloading Werkzeug-0.9.4.tar.gz <span style="color:#ce5c00;font-weight:bold">(</span>1.1MB<span style="color:#ce5c00;font-weight:bold">)</span>
100% <span style="color:#000;font-weight:bold">|</span>████████████████████████████████<span style="color:#000;font-weight:bold">|</span> 1.1MB 1.1MB/s
Collecting <span style="color:#000">gunicorn</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>19.1.1 <span style="color:#ce5c00;font-weight:bold">(</span>from -r pip_requirements.txt <span style="color:#ce5c00;font-weight:bold">(</span>line 5<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">)</span>
Downloading gunicorn-19.1.1-py2.py3-none-any.whl <span style="color:#ce5c00;font-weight:bold">(</span>104kB<span style="color:#ce5c00;font-weight:bold">)</span>
100% <span style="color:#000;font-weight:bold">|</span>████████████████████████████████<span style="color:#000;font-weight:bold">|</span> 112kB 3.4MB/s
Collecting python-dateutil<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>2.2 <span style="color:#ce5c00;font-weight:bold">(</span>from -r pip_requirements.txt <span style="color:#ce5c00;font-weight:bold">(</span>line 6<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">)</span>
Downloading python-dateutil-2.2.tar.gz <span style="color:#ce5c00;font-weight:bold">(</span>259kB<span style="color:#ce5c00;font-weight:bold">)</span>
100% <span style="color:#000;font-weight:bold">|</span>████████████████████████████████<span style="color:#000;font-weight:bold">|</span> 266kB 1.9MB/s
Collecting <span style="color:#000">requests</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>2.3.0 <span style="color:#ce5c00;font-weight:bold">(</span>from -r pip_requirements.txt <span style="color:#ce5c00;font-weight:bold">(</span>line 7<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">)</span>
Downloading requests-2.3.0-py2.py3-none-any.whl <span style="color:#ce5c00;font-weight:bold">(</span>452kB<span style="color:#ce5c00;font-weight:bold">)</span>
100% <span style="color:#000;font-weight:bold">|</span>████████████████████████████████<span style="color:#000;font-weight:bold">|</span> 460kB 305kB/s
Collecting mysql-python <span style="color:#ce5c00;font-weight:bold">(</span>from -r pip_requirements.txt <span style="color:#ce5c00;font-weight:bold">(</span>line 8<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">)</span>
Downloading MySQL-python-1.2.5.zip <span style="color:#ce5c00;font-weight:bold">(</span>108kB<span style="color:#ce5c00;font-weight:bold">)</span>
100% <span style="color:#000;font-weight:bold">|</span>████████████████████████████████<span style="color:#000;font-weight:bold">|</span> 112kB 2.4MB/s
Collecting python-ldap <span style="color:#ce5c00;font-weight:bold">(</span>from -r pip_requirements.txt <span style="color:#ce5c00;font-weight:bold">(</span>line 9<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">)</span>
Downloading python-ldap-2.4.45.tar.gz <span style="color:#ce5c00;font-weight:bold">(</span>296kB<span style="color:#ce5c00;font-weight:bold">)</span>
100% <span style="color:#000;font-weight:bold">|</span>████████████████████████████████<span style="color:#000;font-weight:bold">|</span> 296kB 2.6MB/s
Collecting itsdangerous&gt;<span style="color:#ce5c00;font-weight:bold">=</span>0.21 <span style="color:#ce5c00;font-weight:bold">(</span>from <span style="color:#000">Flask</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>0.10.1-&gt;-r pip_requirements.txt <span style="color:#ce5c00;font-weight:bold">(</span>line 1<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">)</span>
Downloading itsdangerous-0.24.tar.gz <span style="color:#ce5c00;font-weight:bold">(</span>46kB<span style="color:#ce5c00;font-weight:bold">)</span>
100% <span style="color:#000;font-weight:bold">|</span>████████████████████████████████<span style="color:#000;font-weight:bold">|</span> 51kB 2.4MB/s
Collecting Babel&gt;<span style="color:#ce5c00;font-weight:bold">=</span>1.0 <span style="color:#ce5c00;font-weight:bold">(</span>from Flask-Babel<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>0.9-&gt;-r pip_requirements.txt <span style="color:#ce5c00;font-weight:bold">(</span>line 2<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">)</span>
Downloading Babel-2.5.1-py2.py3-none-any.whl <span style="color:#ce5c00;font-weight:bold">(</span>6.8MB<span style="color:#ce5c00;font-weight:bold">)</span>
100% <span style="color:#000;font-weight:bold">|</span>████████████████████████████████<span style="color:#000;font-weight:bold">|</span> 6.8MB 196kB/s
Collecting speaklater&gt;<span style="color:#ce5c00;font-weight:bold">=</span>1.2 <span style="color:#ce5c00;font-weight:bold">(</span>from Flask-Babel<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>0.9-&gt;-r pip_requirements.txt <span style="color:#ce5c00;font-weight:bold">(</span>line 2<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">)</span>
Downloading speaklater-1.3.tar.gz
Collecting markupsafe <span style="color:#ce5c00;font-weight:bold">(</span>from <span style="color:#000">Jinja2</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>2.7.2-&gt;-r pip_requirements.txt <span style="color:#ce5c00;font-weight:bold">(</span>line 3<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">)</span>
Downloading MarkupSafe-1.0.tar.gz
Collecting six <span style="color:#ce5c00;font-weight:bold">(</span>from python-dateutil<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>2.2-&gt;-r pip_requirements.txt <span style="color:#ce5c00;font-weight:bold">(</span>line 6<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">)</span>
Downloading six-1.11.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools in ./env/lib/python2.7/site-packages/setuptools-33.1.1-py2.7.egg <span style="color:#ce5c00;font-weight:bold">(</span>from python-ldap-&gt;-r pip_requirements.txt <span style="color:#ce5c00;font-weight:bold">(</span>line 9<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">)</span>
Collecting pytz&gt;<span style="color:#ce5c00;font-weight:bold">=</span>0a <span style="color:#ce5c00;font-weight:bold">(</span>from Babel&gt;<span style="color:#ce5c00;font-weight:bold">=</span>1.0-&gt;Flask-Babel<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>0.9-&gt;-r pip_requirements.txt <span style="color:#ce5c00;font-weight:bold">(</span>line 2<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">)</span>
Downloading pytz-2017.2-py2.py3-none-any.whl <span style="color:#ce5c00;font-weight:bold">(</span>484kB<span style="color:#ce5c00;font-weight:bold">)</span>
100% <span style="color:#000;font-weight:bold">|</span>████████████████████████████████<span style="color:#000;font-weight:bold">|</span> 491kB 1.7MB/s
Installing collected packages: Werkzeug, markupsafe, Jinja2, itsdangerous, Flask, pytz, Babel, speaklater, Flask-Babel, gunicorn, six, python-dateutil, requests, mysql-python, python-ldap
Running setup.py install <span style="color:#204a87;font-weight:bold">for</span> Werkzeug ... <span style="color:#204a87;font-weight:bold">done</span>
Running setup.py install <span style="color:#204a87;font-weight:bold">for</span> markupsafe ... <span style="color:#204a87;font-weight:bold">done</span>
Running setup.py install <span style="color:#204a87;font-weight:bold">for</span> Jinja2 ... <span style="color:#204a87;font-weight:bold">done</span>
Running setup.py install <span style="color:#204a87;font-weight:bold">for</span> itsdangerous ... <span style="color:#204a87;font-weight:bold">done</span>
Running setup.py install <span style="color:#204a87;font-weight:bold">for</span> Flask ... <span style="color:#204a87;font-weight:bold">done</span>
Running setup.py install <span style="color:#204a87;font-weight:bold">for</span> speaklater ... <span style="color:#204a87;font-weight:bold">done</span>
Running setup.py install <span style="color:#204a87;font-weight:bold">for</span> Flask-Babel ... <span style="color:#204a87;font-weight:bold">done</span>
Running setup.py install <span style="color:#204a87;font-weight:bold">for</span> python-dateutil ... <span style="color:#204a87;font-weight:bold">done</span>
Running setup.py install <span style="color:#204a87;font-weight:bold">for</span> mysql-python ... <span style="color:#204a87;font-weight:bold">done</span>
Running setup.py install <span style="color:#204a87;font-weight:bold">for</span> python-ldap ... <span style="color:#204a87;font-weight:bold">done</span>
Successfully installed Babel-2.5.1 Flask-0.10.1 Flask-Babel-0.9 Jinja2-2.7.2 Werkzeug-0.9.4 gunicorn-19.1.1 itsdangerous-0.24 markupsafe-1.0 mysql-python-1.2.5 python-dateutil-2.2 python-ldap-2.4.45 pytz-2017.2 requests-2.3.0 six-1.11.0 speaklater-1.3</code></pre></div>
<p>5、修改配置</p>

<p>#配置说明：</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-ini" data-lang="ini"><span style="color:#c4a000">dashboard的配置文件为： &#39;rrd/config.py&#39;，请根据实际情况修改</span>
 
<span style="color:#8f5902;font-style:italic">## API_ADDR 表示后端api组件的地址</span>
<span style="color:#c4a000">API_ADDR</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">&#34;http://127.0.0.1:8080/api/v1&#34;</span>
 
<span style="color:#8f5902;font-style:italic">## 根据实际情况，修改PORTAL_DB_*, 默认用户名为root，默认密码为&#34;&#34;</span>
<span style="color:#8f5902;font-style:italic">## 根据实际情况，修改ALARM_DB_*, 默认用户名为root，默认密码为&#34;&#34;</span></code></pre></div>
<p>#修改方法</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-ini" data-lang="ini"><span style="color:#c4a000">[root@Open-Falcon-client]#cd /home/work/open-falcon/dashboard/rrd</span>
 
<span style="color:#c4a000">[root@Open-Falcon-client rrd]# cp config.py config.py.bak</span>
 
<span style="color:#c4a000">(env)[root@Open-Falcon-client rrd]# vi config.py</span>
<span style="color:#8f5902;font-style:italic">#-*-coding:utf8-*-</span>
<span style="color:#8f5902;font-style:italic"># Copyright 2017 Xiaomi, Inc.</span>
<span style="color:#8f5902;font-style:italic">#</span>
<span style="color:#8f5902;font-style:italic"># Licensed under the Apache License, Version 2.0 (the &#34;License&#34;);</span>
<span style="color:#8f5902;font-style:italic"># you may not use this file except in compliance with the License.</span>
<span style="color:#8f5902;font-style:italic"># You may obtain a copy of the License at</span>
<span style="color:#8f5902;font-style:italic">#</span>
<span style="color:#8f5902;font-style:italic"># http://www.apache.org/licenses/LICENSE-2.0</span>
<span style="color:#8f5902;font-style:italic">#</span>
<span style="color:#8f5902;font-style:italic"># Unless required by applicable law or agreed to in writing, software</span>
<span style="color:#8f5902;font-style:italic"># distributed under the License is distributed on an &#34;AS IS&#34; BASIS,</span>
<span style="color:#8f5902;font-style:italic"># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
<span style="color:#8f5902;font-style:italic"># See the License for the specific language governing permissions and</span>
<span style="color:#8f5902;font-style:italic"># limitations under the License.</span>
 
 
<span style="color:#8f5902;font-style:italic"># app config</span>
<span style="color:#c4a000">import os</span>
<span style="color:#c4a000">LOG_LEVEL</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">os.environ.get(&#34;LOG_LEVEL&#34;,&#39;DEBUG&#39;)</span>
<span style="color:#c4a000">SECRET_KEY</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">os.environ.get(&#34;SECRET_KEY&#34;,&#34;secret-key&#34;)</span>
<span style="color:#c4a000">PERMANENT_SESSION_LIFETIME</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">os.environ.get(&#34;PERMANENT_SESSION_LIFETIME&#34;,3600 * 24 * 30)</span>
<span style="color:#c4a000">SITE_COOKIE</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">os.environ.get(&#34;SITE_COOKIE&#34;,&#34;open-falcon-ck&#34;)</span>
 
<span style="color:#8f5902;font-style:italic"># Falcon+ API</span>
<span style="color:#c4a000">API_ADDR</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">os.environ.get(&#34;API_ADDR&#34;,&#34;http://192.168.1.180:8080/api/v1&#34;)</span>
 
<span style="color:#8f5902;font-style:italic"># portal database</span>
<span style="color:#8f5902;font-style:italic"># TODO: read from api instead of db</span>
<span style="color:#c4a000">PORTAL_DB_HOST</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">os.environ.get(&#34;PORTAL_DB_HOST&#34;,&#34;192.168.1.180&#34;)</span>
<span style="color:#c4a000">PORTAL_DB_PORT</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">int(os.environ.get(&#34;PORTAL_DB_PORT&#34;,3306))</span>
<span style="color:#c4a000">PORTAL_DB_USER</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">os.environ.get(&#34;PORTAL_DB_USER&#34;,&#34;root&#34;)</span>
<span style="color:#c4a000">PORTAL_DB_PASS</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">os.environ.get(&#34;PORTAL_DB_PASS&#34;,&#34;password&#34;)</span>
<span style="color:#c4a000">PORTAL_DB_NAME</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">os.environ.get(&#34;PORTAL_DB_NAME&#34;,&#34;falcon_portal&#34;)</span>
 
<span style="color:#8f5902;font-style:italic"># alarm database</span>
<span style="color:#8f5902;font-style:italic"># TODO: read from api instead of db</span>
<span style="color:#c4a000">ALARM_DB_HOST</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">os.environ.get(&#34;ALARM_DB_HOST&#34;,&#34;192.168.1.180&#34;)</span>
<span style="color:#c4a000">ALARM_DB_PORT</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">int(os.environ.get(&#34;ALARM_DB_PORT&#34;,3306))</span>
<span style="color:#c4a000">ALARM_DB_USER</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">os.environ.get(&#34;ALARM_DB_USER&#34;,&#34;root&#34;)</span>
<span style="color:#c4a000">ALARM_DB_PASS</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">os.environ.get(&#34;ALARM_DB_PASS&#34;,&#34;password&#34;)</span>
<span style="color:#c4a000">ALARM_DB_NAME</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">os.environ.get(&#34;ALARM_DB_NAME&#34;,&#34;alarms&#34;)</span>
 
<span style="color:#8f5902;font-style:italic"># ldap config</span>
<span style="color:#c4a000">LDAP_ENABLED</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">os.environ.get(&#34;LDAP_ENABLED&#34;,False)</span>
<span style="color:#c4a000">LDAP_SERVER</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">os.environ.get(&#34;LDAP_SERVER&#34;,&#34;ldap.forumsys.com:389&#34;)</span>
<span style="color:#c4a000">LDAP_BASE_DN</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">os.environ.get(&#34;LDAP_BASE_DN&#34;,&#34;dc=example,dc=com&#34;)</span>
<span style="color:#c4a000">LDAP_BINDDN_FMT</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">os.environ.get(&#34;LDAP_BINDDN_FMT&#34;,&#34;uid=%s,dc=example,dc=com&#34;)</span>
<span style="color:#c4a000">LDAP_SEARCH_FMT</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">os.environ.get(&#34;LDAP_SEARCH_FMT&#34;,&#34;uid=%s&#34;)</span>
<span style="color:#c4a000">LDAP_ATTRS</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">[&#34;cn&#34;,&#34;mail&#34;,&#34;telephoneNumber&#34;]</span>
<span style="color:#c4a000">LDAP_TLS_START_TLS</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">False</span>
<span style="color:#c4a000">LDAP_TLS_CACERTDIR</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">&#34;&#34;</span>
<span style="color:#c4a000">LDAP_TLS_CACERTFILE</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">&#34;/etc/openldap/certs/ca.crt&#34;</span>
<span style="color:#c4a000">LDAP_TLS_CERTFILE</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">&#34;&#34;</span>
<span style="color:#c4a000">LDAP_TLS_KEYFILE</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">&#34;&#34;</span>
<span style="color:#c4a000">LDAP_TLS_REQUIRE_CERT</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">True</span>
<span style="color:#c4a000">LDAP_TLS_CIPHER_SUITE</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">&#34;&#34;</span>
 
<span style="color:#8f5902;font-style:italic"># i18n</span>
<span style="color:#c4a000">BABEL_DEFAULT_LOCALE</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">&#39;zh_CN&#39;</span>
<span style="color:#c4a000">BABEL_DEFAULT_TIMEZONE</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">&#39;Asia/Shanghai&#39;</span>
<span style="color:#8f5902;font-style:italic"># aviliable translations</span>
<span style="color:#c4a000">LANGUAGES</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">{</span>
<span style="color:#c4a000">&#39;en&#39;: &#39;English&#39;,</span>
<span style="color:#c4a000">&#39;zh_CN&#39;: &#39;Chinese-Simplified&#39;,</span>
<span style="color:#c4a000">}</span>
 
<span style="color:#8f5902;font-style:italic"># portal site config</span>
<span style="color:#c4a000">MAINTAINERS</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">[&#39;root&#39;]</span>
<span style="color:#c4a000">CONTACT</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">&#39;root@open-falcon.org&#39;</span>
 
<span style="color:#c4a000">try:</span>
<span style="color:#c4a000">from rrd.local_config import *</span>
<span style="color:#c4a000">except:</span>
<span style="color:#c4a000">print &#34;[warning] no local config file&#34;</span></code></pre></div>
<p>#启动服务</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#8f5902;font-style:italic">#启动服务</span>
有两种方法：
法一：
<span style="color:#ce5c00;font-weight:bold">(</span>env<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">[</span>root@Open-Falcon-client dashboard<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># bash control start</span>
falcon-dashboard started..., <span style="color:#000">pid</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#0000cf;font-weight:bold">40853</span>
 
法二：
<span style="color:#ce5c00;font-weight:bold">(</span>env<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">[</span>root@Open-Falcon-client dashboard<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># ./control start</span>
falcon-dashboard started..., <span style="color:#000">pid</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#0000cf;font-weight:bold">40853</span>
 
<span style="color:#8f5902;font-style:italic">#查看日志</span>
<span style="color:#ce5c00;font-weight:bold">(</span>env<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">[</span>root@Open-Falcon-client dashboard<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># ./control tail</span>
<span style="color:#ce5c00;font-weight:bold">[</span>2017-10-29 15:30:20 +0000<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#ce5c00;font-weight:bold">[</span>40853<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#ce5c00;font-weight:bold">[</span>INFO<span style="color:#ce5c00;font-weight:bold">]</span> Starting gunicorn 19.1.1
<span style="color:#ce5c00;font-weight:bold">[</span>2017-10-29 15:30:20 +0000<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#ce5c00;font-weight:bold">[</span>40853<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#ce5c00;font-weight:bold">[</span>INFO<span style="color:#ce5c00;font-weight:bold">]</span> Listening at: http://0.0.0.0:8081 <span style="color:#ce5c00;font-weight:bold">(</span>40853<span style="color:#ce5c00;font-weight:bold">)</span>
<span style="color:#ce5c00;font-weight:bold">[</span>2017-10-29 15:30:20 +0000<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#ce5c00;font-weight:bold">[</span>40853<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#ce5c00;font-weight:bold">[</span>INFO<span style="color:#ce5c00;font-weight:bold">]</span> Using worker: sync
<span style="color:#ce5c00;font-weight:bold">[</span>2017-10-29 15:30:20 +0000<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#ce5c00;font-weight:bold">[</span>40858<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#ce5c00;font-weight:bold">[</span>INFO<span style="color:#ce5c00;font-weight:bold">]</span> Booting worker with pid: <span style="color:#0000cf;font-weight:bold">40858</span>
<span style="color:#ce5c00;font-weight:bold">[</span>2017-10-29 15:30:20 +0000<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#ce5c00;font-weight:bold">[</span>40863<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#ce5c00;font-weight:bold">[</span>INFO<span style="color:#ce5c00;font-weight:bold">]</span> Booting worker with pid: <span style="color:#0000cf;font-weight:bold">40863</span>
<span style="color:#ce5c00;font-weight:bold">[</span>2017-10-29 15:30:20 +0000<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#ce5c00;font-weight:bold">[</span>40864<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#ce5c00;font-weight:bold">[</span>INFO<span style="color:#ce5c00;font-weight:bold">]</span> Booting worker with pid: <span style="color:#0000cf;font-weight:bold">40864</span>
<span style="color:#ce5c00;font-weight:bold">[</span>2017-10-29 15:30:20 +0000<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#ce5c00;font-weight:bold">[</span>40866<span style="color:#ce5c00;font-weight:bold">]</span> <span style="color:#ce5c00;font-weight:bold">[</span>INFO<span style="color:#ce5c00;font-weight:bold">]</span> Booting worker with pid: <span style="color:#0000cf;font-weight:bold">40866</span>
 
<span style="color:#8f5902;font-style:italic">#退出env环境</span>
<span style="color:#ce5c00;font-weight:bold">(</span>env<span style="color:#ce5c00;font-weight:bold">)</span><span style="color:#ce5c00;font-weight:bold">[</span>root@Open-Falcon-client dashboard<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># deactivate</span>
<span style="color:#ce5c00;font-weight:bold">[</span>root@Open-Falcon-client dashboard<span style="color:#ce5c00;font-weight:bold">]</span>#</code></pre></div>
<p>#访问网站</p>

<p><a href="http://192.168.1.181:8081">http://192.168.1.181:8081</a></p>

<div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220804155231.png" width = 700 /> </div>

<p>#关于登录账号的问题或参考FAQ</p>

<p>请自行注册管理员用户名和密码</p>

<p>#登录界面</p>

<div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220804155256.png" width = 700 /> </div>

<p>6、其它用法</p>

<p>#以开发者模式启动</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">./env/bin/python wsgi.py
open http://127.0.0.1:8081 in your browser.</code></pre></div>
<p>#开启8081端口 （备注：如果关闭了防火墙，则直接忽略这步）</p>

<p>1）防火墙添加8081端口永久开放</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-fallback" data-lang="fallback">firewall-cmd --add-port=8081/tcp --permanent</code></pre></div>
<p>2）重新载入防火墙配置</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-fallback" data-lang="fallback">firewall-cmd --reload</code></pre></div>
<p>#停止dashboard运行</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-fallback" data-lang="fallback">bash control stop</code></pre></div>
<p>#查看dashboard运行状态</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-fallback" data-lang="fallback">bash control status</code></pre></div>
<p>六、FAQ</p>

<ul>
<li>Q: open-falcon v0.2 有管理员帐号吗？</li>
<li>A: 可以通过dashboard自行注册新用户，第一个用户名为root的帐号会被认为是超级管理员，超级管理员可以设置其他用户为管理员。</li>
</ul>

<hr />

<ul>
<li>Q: open-falcon v0.2 dashboard 可以禁止用户自己注册吗？</li>
<li>A: 可以的，在api组件的配置文件中，将<code>signup_disable</code>配置项修改为true，重启api即可。</li>
</ul>

<hr />

    </div>
    <footer class="post-footer">
     
 
<div class="post-tags">     
     
    <a href="http://www.shutdown.cn/tags/linux" rel="tag" title="linux">#linux#</a>
    
    <a href="http://www.shutdown.cn/tags/open-falcon" rel="tag" title="open-falcon">#open-falcon#</a>
    
    <a href="http://www.shutdown.cn/tags/%e5%86%85%e5%ad%98%e4%bc%98%e5%8c%96" rel="tag" title="内存优化">#内存优化#</a>
    
    <a href="http://www.shutdown.cn/tags/%e9%85%8d%e7%bd%ae" rel="tag" title="配置">#配置#</a>
    
    <a href="http://www.shutdown.cn/tags/linux" rel="tag" title="linux">#linux#</a>
    
</div>



     <div class="post-nav">
    <div class="post-nav-next post-nav-item">
    
        <a href="http://www.shutdown.cn/post/detail-about-redis-monitor-and-alarm/" rel="next" title="细说Redis监控和告警">
        <i class="fa fa-chevron-left"></i> 细说Redis监控和告警
        </a>
    
    </div>

    <div class="post-nav-prev post-nav-item">
    
        <a href="http://www.shutdown.cn/post/common-monitoring-metrics-for-linux/" rel="prev" title="Linux常用监控指标">
        Linux常用监控指标 <i class="fa fa-chevron-right"></i>
        </a>
    
    </div>
</div>
      
     
     
     






    </footer>
  </article>
</section>

          </div>
        </div>
        <div class="sidebar-toggle">
  <div class="sidebar-toggle-line-wrap">
    <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
    <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
    <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
  </div>
</div>
<aside id="sidebar" class="sidebar">
  <div class="sidebar-inner">

  <ul class="sidebar-nav motion-element">
    <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
      文章目录
    </li>
    <li class="sidebar-nav-overview" data-target="site-overview">
      站点概览
    </li>
  </ul>

    <section class="site-overview sidebar-panel ">
      <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image"
        src="http://www.shutdown.cn/img/author.jpg"
        alt="不与天斗Domino" />
    <p class="site-author-name" itemprop="name">不与天斗Domino</p>
    <p class="site-description motion-element" itemprop="description"> 
        Programmer &amp; Architect</p>
</div>
      <nav class="site-state motion-element">
    <div class="site-state-item site-state-posts">
      <a href="http://www.shutdown.cn/post/">
        <span class="site-state-item-count">183</span>
        <span class="site-state-item-name">日志</span>
      </a>
    </div>
    <div class="site-state-item site-state-categories">    
        <a href="http://www.shutdown.cn/categories/">      
         
        <span class="site-state-item-count">15</span>
        
        <span class="site-state-item-name">分类</span>
        
        </a>
    </div>

    <div class="site-state-item site-state-tags">
        <a href="http://www.shutdown.cn/tags/">
         
        <span class="site-state-item-count">224</span>
        
        <span class="site-state-item-name">标签</span>
        </a>
    </div>
</nav>
      
      

      

      <div class="links-of-blogroll motion-element inline">
<script type="text/javascript" src="//rf.revolvermaps.com/0/0/8.js?i=&amp;m=0&amp;s=220&amp;c=ff0000&amp;cr1=ffffff&amp;f=arial&amp;l=33&amp;bv=35" async="async"></script>
</div>

    </section>
    
<section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
    <div class="post-toc">
        <div class="post-toc-content"><nav id="TableOfContents">
<ul>
<li>
<ul>
<li>
<ul>
<li><a href="#一-open-falcon介绍">一、Open-Falcon介绍</a></li>
<li><a href="#二-zabbix-nagios-open-falcon这3大开源运维监控工具的比较">二、Zabbix、Nagios、Open-Falcon这3大开源运维监控工具的比较</a></li>
<li><a href="#三-open-falcon编写的整个脑洞历程">三、Open-Falcon编写的整个脑洞历程</a></li>
<li><a href="#四-后端部署-服务端">四、后端部署（服务端）</a></li>
<li><a href="#五-前端部署-备注-在另外一台服务器上面操作">五、前端部署 （备注：在另外一台服务器上面操作）</a></li>
</ul></li>
</ul></li>
</ul>
</nav></div>
    </div>
</section>

  </div>
</aside>

      </div>
    </main>
   
    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  <span itemprop="copyrightYear">  &copy; 
  2013 - 2023</span>
  <span class="with-love"><i class="fa fa-heart"></i></span>
  <span class="author" itemprop="copyrightHolder">天地维杰网</span>
  <span class="icp" itemprop="copyrightHolder"><a href="https://beian.miit.gov.cn/" target="_blank">京ICP备13019191号-1</a></span>
</div>
<div class="powered-by">
  Powered by - <a class="theme-link" href="http://gohugo.io" target="_blank" title="hugo" >Hugo v0.63.2</a>
</div>
<div class="theme-info">
  Theme by - <a class="theme-link" href="https://github.com/xtfly/hugo-theme-next" target="_blank"> NexT
  </a>
</div>


      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
      <span id="scrollpercent"><span>0</span>%</span>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/jquery/index.js?v=2.1.3"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/fastclick/lib/fastclick.min.js?v=1.0.6"></script> 
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/velocity/velocity.min.js?v=1.2.1"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/velocity/velocity.ui.min.js?v=1.2.1"></script>
<script src="http://www.shutdown.cn/js/vendor/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>

<script src="http://www.shutdown.cn/js/vendor/fancybox/jquery.fancybox.pack.js?v=2.1.5"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/utils.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/motion.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/affix.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/schemes/pisces.js"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/scrollspy.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/post-details.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/toc.js"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/bootstrap.js"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX", "output/HTML-CSS"],
    tex2jax: {
      inlineMath: [ ['$','$'] ],
      displayMath: [ ['$$','$$'] ],
      processEscapes: true
    },
    "HTML-CSS": { fonts: ["TeX"] }
  });
</script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML' async></script>
</body>
</html>